package com.letoken.platform.repo.mall.dao;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.letoken.platform.repo.admin.req.mall.AmbListReq;
import com.letoken.platform.repo.admin.req.mall.AmbReleaseListReq;
import com.letoken.platform.repo.admin.res.mall.AmbListRes;
import com.letoken.platform.repo.admin.res.mall.AmbReleaseListRes;
import com.letoken.platform.repo.mall.po.AppMallAmbassadorRelease;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.math.BigDecimal;

/**
 * <p>
 * 推广分红释放记录 Mapper 接口
 * </p>
 *
 * @author author
 * @since 2023-06-08
 */
public interface AppMallAmbassadorReleaseMapper extends BaseMapper<AppMallAmbassadorRelease> {

    @Select("select IFNULL(sum(amount),0) from app_mall_ambassador_release where create_time >= #{startTime} and create_time < #{endTime}")
    BigDecimal statisticsReleaseData(@Param("startTime") String startTime, @Param("endTime") String endTime);



    Page<AmbReleaseListRes> getAmbReleaseRecord(@Param("page") Page<AmbReleaseListRes> page, @Param("req") AmbReleaseListReq req);




}
